//
//  OrderInfoCell.m
//  KuWoCan
//
//  Created by hwd on 17/3/14.
//  Copyright © 2017年 hwd. All rights reserved.
//

#import "OrderInfoCell.h"


/************************************************************************/

/**************************订单信息单元格***********************************/

/************************************************************************/

@implementation OrderInfoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self setUpUI];
    }
    return self;
}

- (void)setUpUI
{
    _firLab = [[UILabel alloc] init];
    _firLab.textColor = [UIColor grayColor];
    _firLab.font = [UIFont systemFontOfSize:14.0];
    _firLab.textAlignment = NSTextAlignmentLeft;
    _firLab.text = @"订单编号: 201702270132";
    [self addSubview:_firLab];
    [_firLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@15);
        make.height.equalTo(@14);
        make.top.equalTo(@15);
    }];
    
    _secLab = [UILabel new];
    _secLab.textColor = [UIColor grayColor];
    _secLab.font = [UIFont systemFontOfSize:14.0];
    _secLab.textAlignment = NSTextAlignmentLeft;
    _secLab.text = @"提交时间: 2017-02-23 10:30";
    [self addSubview:_secLab];
    [_secLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_firLab.mas_left);
        make.height.equalTo(@14);
        make.top.equalTo(_firLab.mas_bottom).offset(10 * screenW_6);
    }];
    
    _thirdLab = [UILabel new];
    _thirdLab.textColor = [UIColor grayColor];
    _thirdLab.font = [UIFont systemFontOfSize:14.0];
    _thirdLab.textAlignment = NSTextAlignmentLeft;
    _thirdLab.text = @"订单备注: 请在工作日配送";
    [self addSubview:_thirdLab];
    [_thirdLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_firLab.mas_left);
        make.height.equalTo(@14);
        make.top.equalTo(_secLab.mas_bottom).offset(10 * screenW_6);
    }];
    
    _personLab = [UILabel new];
    _personLab.textColor = [UIColor grayColor];
    _personLab.font = [UIFont systemFontOfSize:14.0];
    _personLab.textAlignment = NSTextAlignmentLeft;
    _personLab.text = @"收货地址: 张三丰 18607214543";
    [self addSubview:_personLab];
    [_personLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_firLab.mas_left);
        make.height.equalTo(@14);
        make.top.equalTo(_thirdLab.mas_bottom).offset(10 * screenW_6);
    }];

    _addressLab = [UILabel new];
    _addressLab.textColor = [UIColor grayColor];
    _addressLab.font = [UIFont systemFontOfSize:14.0];
    _addressLab.textAlignment = NSTextAlignmentLeft;
    _addressLab.numberOfLines = 0;
    _addressLab.text = @"                武汉市 光谷大道 未来之光 7-1107";
    [self addSubview:_addressLab];
    [_addressLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_firLab.mas_left);
        make.height.greaterThanOrEqualTo(@14);
        make.right.equalTo(@0);
        make.top.equalTo(_personLab.mas_bottom).offset(10 * screenW_6);
//        make.bottom.equalTo(@-15);
    }];

    self.refuseLabel = [[UILabel alloc] init];
    self.refuseLabel.textColor = [UIColor grayColor];
    self.refuseLabel.font = KwFont(14);
    self.refuseLabel.numberOfLines = 0;
    [self addSubview:self.refuseLabel];
    [self.refuseLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_firLab);
        make.right.equalTo(@(-10 * screenW_6));
        make.top.equalTo(_addressLab.mas_bottom).offset(10 * screenW_6);
        make.bottom.equalTo(@(-15 * screenW_6));
    }];

}


@end
